package com.tianyang.yukuaifuzs.business.auth.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.tianyang.yukuaifuzs.R;
import com.tianyang.yukuaifuzs.business.auth.bean.BusinessOutput;
import com.tianyang.yukuaifuzs.business.auth.contract.AuthConfig;
import com.tianyang.yukuaifuzs.utils.VerifyUtil;

import java.util.ArrayList;

/**
 * Description：行业类别
 * Created by xyj on 2024/3/15
 */
public class BusinessInfoAdapter extends BaseQuickAdapter<BusinessOutput, BaseViewHolder> {

    private String mccType;

    public BusinessInfoAdapter(String mccType) {
        super(R.layout.item_business_info, new ArrayList<>());
        this.mccType = mccType;
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, BusinessOutput item) {
        if (item != null) {
            switch (mccType) {
                case AuthConfig.MCC_TYPE_BUSINESS:
                    helper.setText(R.id.titleTv, VerifyUtil.checkString(item.getMccName()));
                    break;
                case AuthConfig.MCC_TYPE_BANK:
                    helper.setText(R.id.titleTv, VerifyUtil.checkString(item.getBranchBankName()));
                    break;
                case AuthConfig.MCC_TYPE_ALI:
                case AuthConfig.MCC_TYPE_WX:
                    helper.setText(R.id.titleTv, VerifyUtil.checkString(item.getTypeThree()));
                    break;
            }
        }
    }
}
